﻿<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>Beehive</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">

    <div th:replace="common :: commonHeader"></div>

    <script th:src="@{/layui/layui.js}"></script>



</head>

<body>
<!-- 应用公共头部 -->
<header th:replace="~{common :: header}"></header>

<!-- 导航条 -->
<nav th:replace="common :: commonNav"></nav>

<!-- 轮播图 -->
<div class="banner clear">
    <ul>
        <li th:each="num : ${#numbers.sequence(1, 4)}"></li>
    </ul>
    <p class="num">
        <a th:each="num, stat : ${#numbers.sequence(1, 4)}" th:class="${stat.first} ? 'active'"></a>
    </p>

</div>

<div class="box">
    <div class="box_1 box_con">
        <h3>编者推荐</h3>
        <ul class="clear">
            <li th:each="book, stat : ${commendList}"
                th:style="${stat.index == 0 || stat.index == 5 ? 'margin-left:20px' : ''}">
                <a th:href="@{/detail(id = ${book.id})}">
                    <img th:src="${book.img == null} ? '/img/default_book.png' : ${#strings.replace(book.img,'d:/bms/book','/path')}"
                         width="153px" height="153px">
                </a>
                <p>
                    <a th:href="@{/detail(id = ${book.id})}"
                       th:text="${#strings.length(book.title)} > 17 ? ${#strings.substring(book.title,0, 13)} + '...' : ${book.title}"></a>
                </p>
            </li>
        </ul>
    </div>

    <div class="box_2 box_con">
        <h3>新书速递</h3>
        <ul class="clear">
            <li th:each="book : ${recentList}">
                <a th:href="@{'/theme/' + ${book.themeId}}"><b th:text="|[${book.keyword}]|"></b></a>
                <a th:href="@{/detail(id=${book.id})}"><strong th:text="${book.title}"></strong></a>
                <time>[[${#dates.format(book.uploadTime, 'yyyy-MM-dd')}]]</time>
            </li>
        </ul>
    </div>

    <div class="box_3 clear">
        <!-- 作者模块展示不做单独页面 -->
        <ul class="author clear">
            <h4>作者</h4>
            <li th:each="book : ${authorList}">
                <a th:href="@{/detail(id = ${book.id})}">
                    <img th:src="${book.img == null} ? '/img/default_book.png' : ${#strings.replace(book.img,'d:/bms/book','/path')}">
                    <div class="mask"></div>
                    <p>[[${#strings.length(book.author) > 4} ? ${#strings.substring(book.author, 0, 3)} + '……' :
                        ${book.author}]]</p>
                </a>
            </li>
        </ul>
        <ul class="press clear">
            <h4>出版社</h4>
            <li class="ease" th:each="press : ${pressList}">
                <img th:src="${#strings.replace(press.img,'d:/bms/book','/path')}">
            </li>
        </ul>
    </div>

</div>

<footer th:replace="common :: commonFooter"></footer>

</body>
</html>
